/*
 * Copyright (C) 2018 Baidu, Inc. All Rights Reserved.
 */
package com.bootdo.hjh.vo;

import java.text.SimpleDateFormat;

import com.bootdo.hjh.domain.WithdrawDO;

public class WithdrawAdminVO {

    private Integer id;

    private Integer userId;

    private String username;

    private String amount;

    private String serviceCharge;

    private String exchangeAmount;

    private Integer status;

    private String cardNumber;

    private String bankName;

    private String cardUserName;

    private String remitTime;

    private String createTime;

    private String lastModifyTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getServiceCharge() {
        return serviceCharge;
    }

    public void setServiceCharge(String serviceCharge) {
        this.serviceCharge = serviceCharge;
    }

    public String getExchangeAmount() {
        return exchangeAmount;
    }

    public void setExchangeAmount(String exchangeAmount) {
        this.exchangeAmount = exchangeAmount;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getCardUserName() {
        return cardUserName;
    }

    public void setCardUserName(String cardUserName) {
        this.cardUserName = cardUserName;
    }

    public String getRemitTime() {
        return remitTime;
    }

    public void setRemitTime(String remitTime) {
        this.remitTime = remitTime;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(String lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    public WithdrawAdminVO copyFrom(WithdrawDO withdrawDO) {
        this.id = withdrawDO.getId();
        this.userId = withdrawDO.getUserId();
//        this.username = withdrawDO.getUsername();
        if(withdrawDO.getAmount()!=null && withdrawDO.getAmount()!=0){
            amount = new java.text.DecimalFormat("#.00").format(withdrawDO.getAmount()/100.0);
        }else{
            amount = "0.00";
        }
        if(withdrawDO.getServiceCharge()!=null && withdrawDO.getServiceCharge()!=0){
            serviceCharge = new java.text.DecimalFormat("#.00").format(withdrawDO.getServiceCharge()/100.0);
        }else{
            serviceCharge = "0.00";
        }
        if(withdrawDO.getExchangeAmount()!=null && withdrawDO.getExchangeAmount()!=0){
            exchangeAmount = new java.text.DecimalFormat("#.00").format(withdrawDO.getExchangeAmount()/100.0);
        }else{
            exchangeAmount = "0.00";
        }
        this.status = withdrawDO.getStatus();
        this.cardNumber = withdrawDO.getCardNumber();
        this.bankName = withdrawDO.getBankName();
        this.cardUserName = withdrawDO.getCardUserName();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if(withdrawDO.getRemitTime()!=null){
            this.remitTime = sdf.format(withdrawDO.getRemitTime());
        }
        if(withdrawDO.getCreateTime()!=null){
            this.createTime = sdf.format(withdrawDO.getCreateTime());
        }
        if(withdrawDO.getLastModifyTime()!=null){
            this.lastModifyTime = sdf.format(withdrawDO.getLastModifyTime());
        }
        return this;
    }
}
